#include <stdio.h>
int main(int argc, char const *argv[])
{
    int grade;
    while (1)
    {
        printf("请输入你的成绩[0,100],按-1退出程序:\n");
        scanf("%d", &grade);
        if (grade > 100 || grade < 0 && grade!=-1)
        {
            printf("你输入的成绩有误!请重新输入:\n");
            continue;
        }
        if (grade >= 90 && grade <= 100)
        {
            printf("你的成绩等级为:A\n");
            break;
        }
        else if (grade >= 80 && grade < 90)
        {
            printf("你的成绩等级为:B\n");
            break;
        }
        else if (grade >= 70 && grade < 80)
        {
            printf("你的成绩等级为:C\n");
            break;
        }
        else if (grade >= 60 && grade < 70)
        {
            printf("你的成绩等级为:D\n");
            break;
        }
        else if (grade >= 0 && grade < 60)
        {
            printf("你的成绩等级为:不及格!\n");
            break;
        }
        else if (grade == -1)
        {
            break;
        }
    }
    return 0;
}
